package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiMplsOtherMapper;
import com.ruoyi.net.domain.ElementBusiMplsOther;
import com.ruoyi.net.service.IElementBusiMplsOtherService;

/**
 * 网元-业务-mpls-其他属性Service业务层处理
 * 
 * @author net
 * @date 2024-11-28
 */
@Service
public class ElementBusiMplsOtherServiceImpl implements IElementBusiMplsOtherService 
{
    @Autowired
    private ElementBusiMplsOtherMapper elementBusiMplsOtherMapper;

    /**
     * 查询网元-业务-mpls-其他属性
     * 
     * @param id 网元-业务-mpls-其他属性主键
     * @return 网元-业务-mpls-其他属性
     */
    @Override
    public ElementBusiMplsOther selectElementBusiMplsOtherById(String id)
    {
        return elementBusiMplsOtherMapper.selectElementBusiMplsOtherById(id);
    }

    /**
     * 查询网元-业务-mpls-其他属性列表
     * 
     * @param elementBusiMplsOther 网元-业务-mpls-其他属性
     * @return 网元-业务-mpls-其他属性
     */
    @Override
    public List<ElementBusiMplsOther> selectElementBusiMplsOtherList(ElementBusiMplsOther elementBusiMplsOther)
    {
        return elementBusiMplsOtherMapper.selectElementBusiMplsOtherList(elementBusiMplsOther);
    }

    /**
     * 新增网元-业务-mpls-其他属性
     * 
     * @param elementBusiMplsOther 网元-业务-mpls-其他属性
     * @return 结果
     */
    @Override
    public int insertElementBusiMplsOther(ElementBusiMplsOther elementBusiMplsOther)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMplsOther.getId())) {
            elementBusiMplsOther.setId(uuid);
        }
        elementBusiMplsOther.setCreateBy(SecurityUtils.getUsername());
        elementBusiMplsOther.setCreateTime(DateUtils.getNowDate());
        elementBusiMplsOther.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsOther.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsOtherMapper.insertElementBusiMplsOther(elementBusiMplsOther);
    }

    /**
     * 修改网元-业务-mpls-其他属性
     * 
     * @param elementBusiMplsOther 网元-业务-mpls-其他属性
     * @return 结果
     */
    @Override
    public int updateElementBusiMplsOther(ElementBusiMplsOther elementBusiMplsOther)
    {
        elementBusiMplsOther.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsOther.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsOtherMapper.updateElementBusiMplsOther(elementBusiMplsOther);
    }

    /**
     * 批量删除网元-业务-mpls-其他属性
     * 
     * @param ids 需要删除的网元-业务-mpls-其他属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsOtherByIds(String[] ids)
    {
        return elementBusiMplsOtherMapper.deleteElementBusiMplsOtherByIds(ids);
    }

    /**
     * 删除网元-业务-mpls-其他属性信息
     * 
     * @param id 网元-业务-mpls-其他属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsOtherById(String id)
    {
        return elementBusiMplsOtherMapper.deleteElementBusiMplsOtherById(id);
    }
}
